//
//  BottomToolBar.m
//  DaoZiJinFu
//
//  Created by woker on 16/6/23.
//  Copyright © 2016年 iwoker. All rights reserved.
//

#import "BottomToolBar.h"

@implementation BottomToolBar

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        _calculate = [[UIButton alloc] init];
        [_calculate setBackgroundColor:[UIColor whiteColor]];
        [self addSubview:_calculate];
        
        UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"计算器"]];
        [_calculate addSubview:img];
        
        [img mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(_calculate.mas_leading).offset(12);
            make.top.equalTo(_calculate.mas_top).offset(12);
            make.trailing.equalTo(_calculate.mas_trailing).offset(-12);
            make.bottom.equalTo(_calculate.mas_bottom).offset(-12);
        }];
        
        _investBtn = [[UIButton alloc]init];
        [_investBtn setBackgroundColor:BLUE_COLOR];
        [_investBtn setTitle:@"立即投资" forState:UIControlStateNormal];
        [self addSubview:_investBtn];
        
        [_calculate mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.mas_leading);
            make.bottom.equalTo(self.mas_bottom);
            make.width.equalTo(@TOOLBAR_HEIGHT);
            make.height.equalTo(@TOOLBAR_HEIGHT);
        }];
        
        [_investBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(self.mas_trailing);
            make.bottom.equalTo(self.mas_bottom);
            make.leading.equalTo(_calculate.mas_trailing);
            make.height.equalTo(@TOOLBAR_HEIGHT);
        }];
    }
    return self;
}

@end
